package com.auxteam.elope;

import com.auxteam.elope.activities.ExampleListActivity;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class LoginActivity extends Activity implements OnClickListener{
	Button btnLogin;
	EditText txtLoginUsername;
	Intent i;
	String username;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_login);
		
		btnLogin = (Button) findViewById(R.id.btnLogin);
		btnLogin.setOnClickListener(this);
		
		txtLoginUsername = (EditText) findViewById(R.id.txtLoginUsername);
		
		
	}
	
	@Override
	public void onBackPressed() {
		super.onBackPressed();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.login, menu);
		return true;
	}

	@Override
	public void onClick(View v) {
		if(v == btnLogin){
			username = txtLoginUsername.getText().toString();
			i = new Intent(getApplicationContext(), CustomHomeScreen.class);
			i.putExtra("username", username);
			startActivity(i);
			finish();
		}
		
	}

}
